home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2510 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  845 b 

  1. Path: fluke-f.icase.edu!erlebach
  2. From: erlebach@fluke-f.icase.edu (Erlebacher Gordon)
  3. Newsgroups: comp.lang.c
  4. Subject: unblocked reads from pipes
  5. Date: 22 Jan 1996 02:35:54 GMT
  6. Organization: ICASE/NASA Langley
  7. Distribution: world
  8. Message-ID: <4dut6a$l3s@reznor.larc.nasa.gov>
  9. NNTP-Posting-Host: fluke.icase.edu
  10.  
  11. I have been using pipes to communcate between two programs.  Program
  12. B is launched from program A (via fork/execl), and 2 pipes are set up,
  13. one for reading from program B, and one to read from it.  When 
  14. using the read routine to read the pipe, I noticed it is blocked.  If the
  15. pipe is empty, the read does not return.  How can I perform either:
  16.  
  17. 1) check for data in the pipe before reading from it,
  18.  
  19. 2) read the pipe in such a way that if it is emply, to return back to 
  20.   the calling module.
  21.  
  22.        Thanks for any help,
  23.  
  24.        Gordon
  25.